package com.xinqi.modules.stats.score.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.common.mybatis.data.repo.SuperMapper;
import com.xinqi.modules.stats.score.domain.CourseTotalScoreEntity;
import com.xinqi.modules.stats.score.dto.req.CourseContentTotalScoreCalDTO;
import com.xinqi.modules.stats.score.dto.req.CourseTotalScoreStudentQueryDTO;
import com.xinqi.modules.stats.score.dto.req.CourseTotalScoreTypeDetailQueryDTO;
import com.xinqi.modules.stats.score.dto.req.CourseTotalScoreTypeQueryDTO;
import com.xinqi.modules.stats.score.dto.rsp.*;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 成绩管理总成绩主表数据层
 *
 * @author: system
 * @date: 2023/03/26
 */
@Mapper
public interface CourseTotalScoreMapper extends SuperMapper<CourseTotalScoreEntity> {

    /*学生端-总成绩学生分类加权后总得分*/
    @MapKey("student_id")
    List<Map<String, Object>> studentAllTotalScoreList(CourseContentTotalScoreCalDTO dto);

    /*学生端-总成绩学生加权后总得分*/
    BigDecimal studentTotalScore(CourseTotalScoreStudentQueryDTO dto);

    /*学生端- 总成绩分类成绩加权后得分*/
    List<TotalScoreStudentTypeInfoDTO> studentTypeTotalScore(CourseTotalScoreStudentQueryDTO dto);

    /*学生端- 总成绩各分类成绩原始得分*/
    List<TotalScoreStudentTypeSonInfoDTO> studentTypeSonTotalScore(CourseTotalScoreStudentQueryDTO dto);

    /*老师端- 总成绩各分类学生成绩加权后得分*/
    List<TotalScoreStudentTypeSonInfoDTO> studentTypeSonCalTotalScore(CourseTotalScoreStudentQueryDTO dto);

    /*学生端-非考勤状态统计*/
    @DS("slaver")
    List<TotalScoreStudentTotalTipDTO> studentTotalScoreTotal(CourseTotalScoreTypeQueryDTO dto);

    /*学生端-考勤状态统计*/
    @DS("slaver")
    List<TotalScoreStudentTotalTipDTO> studentAttendanceTotalScoreTotal(CourseTotalScoreTypeQueryDTO dto);

    /*老师端-考勤各状态人数统计*/
    TotalScoreContentTotalDTO teacherAttendanceTotalScoreTotal(CourseTotalScoreTypeQueryDTO dto);

    /*老师端-各分类学生总得分列表信息*/
    @DS("slaver")
    List<TotalScoreStudentListDTO> teacherStudentTotalScoreList(CourseTotalScoreTypeQueryDTO dto);

    /*老师端-各分类学生总得分列表信息 分页*/
    IPage<TotalScoreStudentListDTO> teacherStudentTotalScorePage(Page page, @Param("query") CourseTotalScoreTypeQueryDTO dto);

    /*老师端-各分类学生得分列表详情*/
    @DS("slaver")
    List<TotalScoreStudentListDTO> teacherStudentDetailScoreList(CourseTotalScoreTypeDetailQueryDTO dto);

    /*学生端-各分类学生得分列表信息*/
    @DS("slaver")
    List<TotalScoreStudentListDTO> studentTotalScoreList(CourseTotalScoreTypeQueryDTO dto);

    /*学生端-各分类学生得分列表信息-分页*/
    IPage<TotalScoreStudentListDTO> studentTotalScorePage(Page page, @Param("query") CourseTotalScoreTypeQueryDTO dto);


    //========================变更功能接口=============================
    /*老师端-各分类学生总得分列表信息 便跟 分页*/
    IPage<TotalScoreStudentListDTO> teacherStudentTotalScorePageV2(Page page, @Param("query") CourseTotalScoreTypeQueryDTO dto);

}
